package net.zjitc.dao;

import net.zjitc.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

public interface MapperUser {
    @Select("select *from user")
    List<User> findByAll();
    @Select("select *from user where id=#{id}")
    User findById(int id);
    @Insert("insert into user (id,name,age) values (#{id},#{name},#{age})")
    int addUser(User user);
    @Update("update user set name=#{name},age=#{age} where id = #{id}")
    int updateUser(User user);
    @Delete("delete from user where id = #{id}")
    int deleteUser(@Param("id")int id);
    @Select("select *from user limit  #{startIndex},#{pageSize}")
    List<User> findByLimit(Map<String,Integer> map);
}
